<template>
	<view>
		<view class="logisticsCode">
			<view class="status">{{msgDict.carrier}}:{{info.company}}</view>
			<view class="code">{{msgDict.trackNum}}:{{info.nu}}</view>
		</view>
		<view class="stepView">
			<uni-steps :options="deliveryArr" direction="column" :active="0" active-color="#D8AA63"></uni-steps>
		</view>
	</view>
</template>

<script>
	import {deliveryBatchDelivery} from '../../api/index.js'
	export default {
		data() {
			return {
				info:{},
				userId:undefined,
				deliveryArr:[],
				msgDict:{}
			}
		},
		onLoad(options) {
			
		   this.msgDict = getApp().globalData.$t('logisticsGoods');
		   this.userId = getApp().globalData.userId;
			if (options.orderCode) {
			
				this.orderCode = options.orderCode
				this.requstOrderInfo({deliveryCode:options.orderCode,type:1});
			
			}
			
		},
		methods: {
			async requstOrderInfo(dict){
				
				let {result} = await deliveryBatchDelivery(dict);
			    this.info = result; 
			    if (result.list) {
			    	
			    let deliveryArr = [];
			    result.list.forEach(v=>{
			    	
			    	deliveryArr.push({title:v.context,desc:v.ftime});
			    	
			    	
			    })
			    this.deliveryArr = deliveryArr;
			    	
			    }
				
			
			}
		}
	}
</script>

<style>
	.logisticsCode{
		 background-color: #fff;
		 margin-bottom: 20rpx;
		 border-bottom-left-radius: 20rpx;
		 border-bottom-right-radius: 20rpx;
		 padding: 30rpx;
		 display: flex;
		 flex-direction: column;
		 justify-content: space-between;
		 border-bottom: 10rpx solid #f2f2f2;
	}
	.status{
		 font-size: 36rpx;
		 color: #333;
		 font-weight: 500;
	}
	.code{
		 color: #ccc;
		 font-size: 30rpx;
		 margin-top: 15rpx;
	}
    .stepView{
		padding: 0 20rpx;
	}
</style>
